# 36. 找到字符串中出现次数最多的一个字符

# s0="hello wrold"
# result={}
# for c in s0:
#     if c not in result:
#         result[c]=1
#     else:
#         result[c]+=1
# print(result)
# max_value=0
# max_char=None
# for k,v in result.items():
#     if max_value<v:
#         max_value=v
#         max_char=k
# print(max_value,max_char)

    # s0="hello wrold"
    # max_value=0
    # max_char=None
    # for c in s0:
    #     count=s0.count(c)
    #     if max_value<count:
    #         max_value=count
    #         max_char=c
    # print(max_value,max_char)
        # s0="15713615763"
        # l0=[]
        # n=0
        # for i in s0:
        #     # print(i,end='\t')  #1	5	7	1	3	6	1	5	7	6	3
        #     for j in l0:
        #         # print(j ,end='\t')
        #         if j[0]==i:
        #             j[1]+=1
        #             break
        #     else:
        #         l0.append([i,1])
        #         n+=1
        # #print(l0)
        # #[['1', 3], ['5', 2], ['7', 2], ['3', 2], ['6', 2]]
        # # print(n)
        #
        # min=num=l0[0][1]
        # max=num=l0[0][1]
        # # print(num)  #  3
        # for m in range(n):
        #     if max<l0[m][1]:
        #         max=l0[m][1]
        #     if min>l0[m][1]:
        #         min=l0[m][1]
        # # print(max,min)  #3 2
        # for l in range(n):
        #     if max==l0[l][1]:
        #         print(l0[l][0])


# # 38.找到1000以内相差为6的质数对（5,11）（7,13）...
# l0=[]
# for i in range(2,1000):
#     for j in  range(2,i):
#         if i%j==0:
#             break
#     else:
#         if i not in l0:
#             l0.append(i)
# # print(l0)
# for count in l0:
#     if count+6 in l0:
#         print(count,count+6)

# # 39.一直输入数字，直到数字之和为5的倍数，求输入数字的平均数
# sum=0
# count=0
# while True:
#     str0=input("请输入一个数：")
#     int0=int(str0)
#     sum+=int0
#     count+=1
#     # print(sum,count)
#     if sum%5==0:
#         print(f'输入{count}个数，平均数为{sum/count}')
#         break

# # 40.输入1 个正整数 n(n<=100)，计算并输出1＋1/2＋1/3＋……＋1/n 。
# str0=input('请输入一个正整数（小于等于100）：')
# n=int(str0)
# sum=0
# for i in range(1,n+1):
#     sum+=1/i
# print(sum)

# # 41.输入两个数，求两个数的最大公约数，最小公倍数
# value1=int(input('输入第一个数'))
# value2=int(input('输入第二个数'))
# max_value=value1 if value1>value2 else value2
# min_value=value1 if value1<value2 else value2
# current=max_value
# while True:
#     if current%value1==0 and current%value2==0:
#         print(current)
#         break
#     else:current+=1
#
# current=min_value
# while True:
#     if value1%current==0 and value2%current==0:
#         print(current)
#         break
#     else:
#         current-=1

                # str1=input("请输入第一个数：")
                # str2=input("请输入第二个数：")
                # int1=int(str1)
                # int2=int(str2)
                # count=0
                # if int1>int2:
                #     for i in range(int2,1,-1):
                #         if int1%i==0 and int2%i==0:
                #             count+=1
                #             if count==1:
                #                 print(f'最大公约数是{i}，最小公倍数是{int1*int2/i}')
                #                 break
                #
                # if int1 < int2:
                #     for i in range(int1, 1, -1):
                #         if int1 % i == 0 and int2 % i == 0:
                #             count += 1
                #             if count == 1:
                #                 print(f'最大公约数是{i}，最小公倍数是{int1*int2/i}')
                #                 break

# # 42.已知四位数3025有一个特殊性质:
# # 它的前两位数字30和后两位数字25的和是 55,
# # 而   55的平方刚好等于该数(55*55=3025).
# # 试编一程序打印所有具有这种性质的四位数.
# count=1000
# while count<10000:
#     a=count//1000
#     b=count//100%10
#     c=count//10%10
#     d=count%10
#     if (a*10+b+c*10+d)**2==count:
#         print(count)
#     count+=1

# 43.找到500到1000以内满足以下的质数对（前两个差值是第二个与第三个差值的一半）

# l0=[]
# for i in range(500,1001):
#     for j in range(2,i):
#         if i%j==0:
#             break
#     else:
#         if i not in l0:
#             l0.append(i)
# print(l0)
                # # for num in range(len(l0)-2):
                # #     if (l0[num+1]-l0[num])==(1/2*(l0[num+2]-l0[num+1])) :
                # #         print(l0[num],l0[num+1],l0[num+2])
# for i in range(len(l0)):
#     for j in range(i+1,len(l0)):
#         value=l0[j]-l0[i]
#         value*=2
#         value+=l0[j]
#         if value in l0:
#             print(l0[i],l0[j],value)

# 44.将第一个字符串与第二个字符串进行拼接
# abcdefg  1234 拼接结果a4b3c2d1efg
# s0="abcdefg"
# s1="1234"
# s2=""
# for i in range(len(s0)):
#     s2+=s0[i]
#     c=s1[len(s1)-1-i]
#     s2+=c
# print(s2)


            # str1 = "abcdefg"
            # str2 = "1234"
            # l1 = list(str1)
            # l2 = list(str2)
            # print(l2, l1)
            # # ['1', '2', '3', '4'] ['a', 'b', 'c', 'd', 'e', 'f', 'g']
            # #  0 1 2 3 4 5 6 7 8 9 10
            # #  a 4 b 3 c 2 d 1 e f g
            #
            # #  a   b   c   d   e f g
            #
            # #    1   2   3   4
            # for i in range(1, len(l2) + 1):
            #     l1.insert(len(l2) - i + 1, i)
            # print(l1, type(l1))
            # # ['a', 4, 'b', 3, 'c', 2, 'd', 1, 'e', 'f', 'g'] <class 'list'>
            # str3 = str(l1)
            # print(str3, type(str3))
            # # ['a', 4, 'b', 3, 'c', 2, 'd', 1, 'e', 'f', 'g'] <class 'str'>

# 45.如何判断一个字符串是否为另一个字符串的子串
# （自己遍历，不使用index,find等方法）

# s0="123456789"
# s1="789"
# for i in range(len(s0)-len(s1)+1):
#     print(s0[i])
#     for j in range(len(s1)):
#         print(s1[j],s0[i+j])
#         if s1[j]!=s0[i+j]:
#             break
#     else:
#         print(f'是子字符串')
#         break
#
# 44.编程实现如下图列出的图形。7行
# *
# ***
# *****
# ******* #4 8 7
# *****   #5 10 5
# ***     #6 12 3
# *       #7 14 1


#
# for i in range(4):
#     for j in range(2*i+1):
#         print('*',end='')
#     print()
# for m in range(4,7):
#     for k in range((6-(m-4)*2)-1):
#         print('*',end='')
#     print()

# r=1 if 8%2==0 else 0
# print(r)

# 45.随机生成10个位于10-50之间的数字，
# 打印25以上与25以下平均数的差值
# import random
# sum1=0
# sum2=0
# count1=0
# count2=0
# for i in range(10):
#     r=random.randint(10,50)
#     print(r)
#     if r >25:
#         sum1+=r
#         count1+=1
#     elif r<25:
#         sum2+=r
#         count2+=1
# print(sum1/count1-sum2/count2)

# 46.斐波那契数列指的是这样一个数列：1，1，2，3，5，8，13，21，34，55，89...
# 求第n个数是几

def get_n(n):
    first=1
    second=1
    current=None
    for i in range(3,n+1):
        current=first+second
        first=second
        second=current
    return current
num=int(input("输入一个数："))
print(get_n(num))